package com.cobra.minio.util;

import org.springframework.http.HttpStatus;

/**
 * @author cobra
 */

public enum ResultStatus {
    /**
     * 调用成功
     */
    SUCCESS(HttpStatus.OK, 200, "success"),
    /**
     * 调用系统错误
     */
    SYS_ERROR(HttpStatus.BAD_REQUEST, 400, "系统错误"),
    /**
     * 服务请求({0})的参数非法
     */
    ERROR_PARAM(HttpStatus.BAD_REQUEST, 400, "参数非法");
    /**
     * 返回的HTTP状态码,  符合http请求
     */
    private HttpStatus httpStatus;
    /**
     * 编码
     */
    private int code;
    private String msg;

    public HttpStatus getHttpStatus() {
        return httpStatus;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    /**
     * 构造方法
     *
     * @param number
     * @param msg
     */
    ResultStatus(HttpStatus httpStatus, int number, String msg) {
        this.httpStatus = httpStatus;
        this.code = number;
        this.msg = msg;
    }
}
